<template>
  <div>
    <div class="attention">
      <div class="atte">关注</div>
      <ul>
        <h3>按关注时间排序</h3>
        <li v-for="(item,index) in atteData" :key="index">
          <div class="img">
            <img
              :src="item.avatarUrl"
            />
          </div>

          <div class="font">
            <h3>{{item.nickname}}</h3>
            <p>{{item.signature}}</p>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { getFollow } from "../api/myself";
export default {
  props: ["uid"],
  data() {
    return {
      atteData: null,
    };
  },
  methods: {
    getFollowFun() {
      getFollow({ uid: this.uid }).then((data) => {
        console.log(data);
        this.atteData  = data.follow;
      });
    },
  },
  created() {
    this.getFollowFun();
  },
};
</script>

<style lang="less">
.attention {
  padding-bottom: 100px;
  .atte {
    width: 100%;
    min-height: 30px;
    line-height: 30px;
    font-size: 20px;
    background-color: #d44439;
    color: #fff;
    text-align: center;
    padding: 8px 8px;
    box-sizing: border-box;
  }
  ul {
    padding: 15px;
    h3 {
      color: #d44439;
      font-size: 16px;
      padding-bottom: 15px;
    }
    li {
      display: flex;
      margin-bottom: 20px;
      .img {
        flex: 0 0 40px;
        width: 80px;
        height: 80px;
        border-radius: 50%;
        padding-right: 10px;
        img {
          width: 80px;
          height: 80px;
          border-radius: 50%;
        }
      }
      .font {
        flex: 1;
        h3 {
          color: #333;
          font-size: 18px;
          padding-bottom: 8px;
          padding-top: 10px;
        }
        p {
          font-size: 13px;
          color: #aaa;
          display: -webkit-box;
          // 3、弹性盒子排列方式：垂直排列：
          -webkit-box-orient: vertical;
          // 4、规定显示几行文本：
          -webkit-line-clamp: 1;
          // 5、溢出隐藏：
          overflow: hidden;
        }
      }
    }
  }
}
</style>